package ptaTest5;


import java.util.Scanner;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class Test552 {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc=new Scanner(System.in);
		Set<String> set =new TreeSet<String>();
		while(sc.hasNext()){
			String str=sc.next();
			if(str.equals("!!!!!")){
				break;
			}
			set.add(str);
		}
		System.out.println(set.size());
		int i=0;
		for (Iterator<String> iterator = set.iterator(); iterator.hasNext()&&i<10;) {
			i++;
			String string = (String) iterator.next();
			System.out.println(string);
		}
	}

}

